/* Simple program to demonstrate the creation and use of variables. */
#include <iostream>
#include <string>

int main()
{
  int i1 = 3, i2(5), i3; // Create three integers, i1, i2, and i3
                         // i2(5) is identical to i2 = 5

  i3 = i1 + i2;

  unsigned int i4 = 3; // Create a non-negative integer
  
  // Create a non-negative integer and mistakenly assign it a negative
  // value. The compiler won't complain about this, but it is not
  // good. Run this program to see to see what value i5 actually has:
  unsigned int i5 = -1; 

  // Print all of the variables. std::endl is a variable defined in
  // iostream which represents a newline.
  std::cout << i1 << "  " << i2 << "  " << i3 << "  " << i4 << "  " 
	    << i5 << std::endl
	    << "sizeof(int) = " << sizeof(int) << std::endl;
  
  
  // Create a string, which is of type std::string. It is not a
  // builtin type. The string type is defined in the file string,
  // which is included above.
  std::string str1 = "Hello", str2(", World!");

  // Print the two strings:
  std::cout << str1 << str2 << std::endl
	    << "sizeof(std::string) = " << sizeof(std::string) << std::endl;
}
